import { formatTime } from '../../utils/util'
let listLoad = require('../../common/mixinList');
Page({
    behaviors: [listLoad],
    data: {
        reqUrl: '/supplier/order/pei',
        day: '', //今日日期
        today_status: '', //供应状态0已完成,大于0未完成
        endTime: '', //选择日期截止
    },
    onLoad: function(options) {
        const today = formatTime(new Date()).slice(0, 10)
        const today_status = Number(options.today_status)
        this.setData({ day: today, today_status, endTime: today })
        this.getList(true)
    },
    getParamsData() { //页面特殊的请求参数，需要时在页面内覆盖此方法，默认返回{}
        return { day: this.data.day.replaceAll('-', '') }
    },
    bindDateChange(e) {
        this.setData({ day: e.detail.value })
        this.getList(true)
    }
})